﻿using Newtonsoft.Json;
using PC.PickleJar.Trello.Domain;
using PC.PickleJar.Trello.Data.Resources;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using PC.PickleJar.Trello.Helpers;

namespace PC.PickleJar.Trello.Data
{
	public class BoardRepository
	{
		private string developerApiKey;
		private string userToken;

		public BoardRepository()
		{
			TrelloConfigurationHelper config = new TrelloConfigurationHelper();
			this.developerApiKey = config.DeveloperApiKey;
			this.userToken = config.UserToken;
		}

		public BoardRepository(String developerApiKey, String userToken)
		{
			this.developerApiKey = developerApiKey;
			this.userToken = userToken;
		}

		public TrelloBoard GetBoard(String boardId)
		{
			TrelloBoard result;

			var client = new TrelloClient<TrelloBoard>(new BoardByIdResource(boardId, this.developerApiKey, this.userToken));

			result = client.GetResource();

			return result;
		}
	}
}
